
<!--员工列表-->
<!--
	操作按钮state
	1代表单独操作公用
	2代表批量操作
	3代表正常账号单独操作
	4代表禁用账号单独操作
-->
<div class="tab-box">
    <ul>
        <li ng-repeat="(i,item) in tabMenu.children track by $index" 
        	ui-sref="{{item.state}}({id:item.id})"
        	ng-class="{active:i==0}">
        	{{item.name}}
        </li>
    </ul>
</div>

<div class="section-search">
	<span class="line-block">
        <ui-select ng-model="params.locked">
        	<ui-option value="-1">员工状态</ui-option>
            <ui-option value="1" >正常</ui-option>
            <ui-option value="2" >冻结</ui-option>
        </ui-select>
   </span>
    <span class="line-block">
        <ui-select ng-model="params.departmentId" placeholder="产品类型">
        	<ui-option value="-1">部门筛选</ui-option>
        	<ui-option ng-repeat="(i,item) in param1.deptList track by $index " value="item.id" >
            	{{item.name}}
           </ui-option>
        </ui-select>
    </span>
    <span class="line-block">
        <ui-select ng-model="params.positionId">
            <ui-option value="-1">职位筛选</ui-option>
            <ui-option ng-repeat="(i,item) in param1.positionList track by $index " value="item.id" >
            	{{item.name}}
            </ui-option>
        </ui-select>
    </span>
    <!-- <span class="line-block filed">
        <ui-select ng-model="params.type" error-tis="err.type" >
            <ui-option value="-1">选择字段</ui-option>
            <ui-option value="1">借款编号</ui-option>
            <ui-option value="2">客户姓名</ui-option>
            <ui-option value="3">身份证</ui-option>
            <ui-option value="4">电话号码</ui-option>
            <ui-option value="5">业务员</ui-option>
      </ui-select>
    </span> -->
    <span class="line-block" style="width: 220px;">
        <input type="text" class="form-control" placeholder="输入姓名/手机号码/用户名" ng-model="params.keyword" />
    </span>
    <span class="line-block">
        <button class="btn btn-success search-btn" ng-click="searchHandle()"><em class="glyphicon glyphicon-search"></em></button>
    </span>
    <span class="line-block">
        <button class="btn btn-success search-btn"
        	 style="background:#cf5857"
        	 ng-click="operation('alert@addstaff')">
        	添加员工
        </button>
    </span>
    <span class="line-block">
        <button class="btn btn-success search-btn" style="background:#2f3847" ui-sref="loanlater.plan">批量导入</button>
    </span>
    <span class="line-block fontSize-i">
		<i class="icon icon-info" style="color: #46ac49;vertical-align: middle;" ></i>
		添加员工需要先设置部门和职位
	</span>
</div>
<div class="dataList">
    <table class="table">
        <thead>
        <tr>
        	<th>全选</th>
            <th>操作</th>
            <th>头像</th>
            <th>用户名</th>
            <th>员工姓名</th>
            <th>手机号码</th>
            <th>职位</th>
            <th>部门</th>
            <th>公司</th>
            <th>绑定微信号</th>
            <th>状态</th>
            <th>最后登录时间</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-if="param1.list.length<1" class="_loading">
            <td colspan="20">
                <div class="no_data">暂时找不到数据</div>
            </td>
        </tr>
        <tr ng-repeat="(i,item) in param1.list track by $index " ng-click="$_fn.tabClick($event)">
            <td>
              <input type="checkbox" name="ch_id" value="{{item.id}}"  oper-data={{item.locked}}>
            </td>
            <td>
                <dropdown placeholder="请选择" ng-click="$event.stopPropagation();" ng-if="item.locked==1">
                    <li ng-repeat="(i,list) in subMenu track by $index" ng-if="list.state==1 || list.state==3" 
                    	ng-click="operation(list.path,{id:item.id,username:item.username,real_name:item.real_name})">
                    	{{list.name}}
                    </li>
                </dropdown>
                <dropdown placeholder="请选择" ng-click="$event.stopPropagation();" ng-if="item.locked==2">
                    <li ng-repeat="(i,list) in subMenu track by $index" ng-if="list.state==1 || list.state==4" 
                    	ng-click="operation(list.path,{id:item.id,username:item.username,real_name:item.real_name})">
                    	{{list.name}}
                    </li>
                </dropdown>
            </td>
            <td>
            	<img src="{{item.photo_url}}" alt="" />
            </td>
            <td>{{item.username}}</td>
            <td>{{item.real_name}}</td>
            <td>{{item.telephone}}</td>
            <td>{{item.position_name}}</td>
            <td>{{item.department_name}}</td>
            <td>{{item.company_name}}</td>
            <td>{{item.wechat}}</td>
            <td ng-init="lockeds=['','正常','冻结']">{{lockeds[item.locked]}}</td>
            <td>{{item.last_login_time}}</td>
        </tr>
        </tbody>
    </table>
</div>
<div class="page" ng-if="param1.list.length>0">
    <div class="operation">
        <label><input type="checkbox"  ng-click="$_fn.ch_id_all($event,'ch_id')">全选</label>
        <!--<dropdown placeholder="批量操作">
            <li>批量删除</li>
            <li>批量撤销</li>
        </dropdown>-->
        <dropdown placeholder="批量操作" ng-click="$event.stopPropagation();">
          <li ng-repeat="(i,items) in subMenu track by $index" ng-if="items.state==2" ng-click="operation(items.path, {batchOper:'true',nowOper:items.name})">{{items.name}}</li>
        </dropdown>
    </div>
    <pages total="{{param1.userPage.total}}" current="param1.userPage.pageNum" page-size="{{param1.userPage.pageSize}}"></pages>
</div>
